Integrand size = 25, antiderivative size = 73 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}-\frac {\sin (c+d x)}{b d} \]
a*x/b^2-sin(d*x+c)/b/d-2*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2) )*(a-b)^(1/2)*(a+b)^(1/2)/b^2/d
Time = 0.31 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.95 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {a (c+d x)-2 \sqrt {-a^2+b^2} \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )-b \sin (c+d x)}{b^2 d} \]
(a*(c + d*x) - 2*Sqrt[-a^2 + b^2]*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[ -a^2 + b^2]] - b*Sin[c + d*x])/(b^2*d)
Time = 0.41 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.19, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {3042, 3503, 3042, 3214, 3042, 3138, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1-\sin \left (c+d x+\frac {\pi }{2}\right )^2}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 3503 |
\(\displaystyle \frac {\int \frac {b+a \cos (c+d x)}{a+b \cos (c+d x)}dx}{b}-\frac {\sin (c+d x)}{b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {b+a \sin \left (c+d x+\frac {\pi }{2}\right )}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}-\frac {\sin (c+d x)}{b d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {\frac {a x}{b}-\frac {\left (a^2-b^2\right ) \int \frac {1}{a+b \cos (c+d x)}dx}{b}}{b}-\frac {\sin (c+d x)}{b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a x}{b}-\frac {\left (a^2-b^2\right ) \int \frac {1}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}}{b}-\frac {\sin (c+d x)}{b d}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {\frac {a x}{b}-\frac {2 \left (a^2-b^2\right ) \int \frac {1}{(a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}d\tan \left (\frac {1}{2} (c+d x)\right )}{b d}}{b}-\frac {\sin (c+d x)}{b d}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {a x}{b}-\frac {2 \left (a^2-b^2\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b d \sqrt {a-b} \sqrt {a+b}}}{b}-\frac {\sin (c+d x)}{b d}\) |
((a*x)/b - (2*(a^2 - b^2)*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b ]])/(Sqrt[a - b]*b*Sqrt[a + b]*d))/b - Sin[c + d*x]/(b*d)
3.6.96.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^ (m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^ m*Simp[A*b*(m + 2) + b*C*(m + 1) - a*C*Sin[e + f*x], x], x], x] /; FreeQ[{a , b, e, f, A, C, m}, x] && !LtQ[m, -1]
Time = 1.69 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.40
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (a +b \right ) \left (a -b \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {-\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}}{d}\) | \(102\) |
default | \(\frac {-\frac {2 \left (a +b \right ) \left (a -b \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {-\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}}{d}\) | \(102\) |
risch | \(\frac {a x}{b^{2}}+\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 b d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 b d}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}+a}{b}\right )}{d \,b^{2}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \sqrt {-a^{2}+b^{2}}-a}{b}\right )}{d \,b^{2}}\) | \(146\) |
1/d*(-2*(a+b)*(a-b)/b^2/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c )/((a-b)*(a+b))^(1/2))+2/b^2*(-b*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^ 2)+a*arctan(tan(1/2*d*x+1/2*c))))
Time = 0.31 (sec) , antiderivative size = 202, normalized size of antiderivative = 2.77 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\left [\frac {2 \, a d x - 2 \, b \sin \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \, b^{2} d}, \frac {a d x - b \sin \left (d x + c\right ) - \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{b^{2} d}\right ] \]
[1/2*(2*a*d*x - 2*b*sin(d*x + c) + sqrt(-a^2 + b^2)*log((2*a*b*cos(d*x + c ) + (2*a^2 - b^2)*cos(d*x + c)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b) *sin(d*x + c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^ 2)))/(b^2*d), (a*d*x - b*sin(d*x + c) - sqrt(a^2 - b^2)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c))))/(b^2*d)]
Leaf count of result is larger than twice the leaf count of optimal. 1039 vs. \(2 (61) = 122\).
Time = 52.51 (sec) , antiderivative size = 1039, normalized size of antiderivative = 14.23 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Too large to display} \]
Piecewise((zoo*x*(1 - cos(c)**2)/cos(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (x/b - sin(c + d*x)/(b*d), Eq(a, b)), (-x/b - sin(c + d*x)/(b*d), Eq(a, -b )), ((-x*sin(c + d*x)**2/2 - x*cos(c + d*x)**2/2 + x - sin(c + d*x)*cos(c + d*x)/(2*d))/a, Eq(b, 0)), (x*(1 - cos(c)**2)/(a + b*cos(c)), Eq(d, 0)), (a*d*x*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2/(b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b ))) + a*d*x*sqrt(-a/(a - b) - b/(a - b))/(b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b))) - a*log(-sq rt(-a/(a - b) - b/(a - b)) + tan(c/2 + d*x/2))*tan(c/2 + d*x/2)**2/(b**2*d *sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b))) - a*log(-sqrt(-a/(a - b) - b/(a - b)) + tan(c/2 + d*x/2))/( b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/( a - b) - b/(a - b))) + a*log(sqrt(-a/(a - b) - b/(a - b)) + tan(c/2 + d*x/ 2))*tan(c/2 + d*x/2)**2/(b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x /2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b))) + a*log(sqrt(-a/(a - b) - b/ (a - b)) + tan(c/2 + d*x/2))/(b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b))) - 2*b*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)/(b**2*d*sqrt(-a/(a - b) - b/(a - b))*tan(c/2 + d*x/2)**2 + b**2*d*sqrt(-a/(a - b) - b/(a - b))) - b*log(-sqrt(-a/(a - b ) - b/(a - b)) + tan(c/2 + d*x/2))*tan(c/2 + d*x/2)**2/(b**2*d*sqrt(-a/...
Exception generated. \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.31 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.67 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {\frac {{\left (d x + c\right )} a}{b^{2}} + \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{b^{2}} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} b}}{d} \]
((d*x + c)*a/b^2 + 2*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) + a rctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(a^2 - b^2))) *sqrt(a^2 - b^2)/b^2 - 2*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 + 1 )*b))/d
Time = 1.94 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.53 \[ \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}}{b^2\,d}-\frac {\sin \left (c+d\,x\right )}{b\,d}+\frac {2\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^2\,d} \]